package cn.nacos.system.controller;

import lombok.extern.log4j.Log4j2;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @Author:ZhouYang
 * @Description:
 * @Date: Created in 2020/8/31 11:33
 * @Modified By：
 */

@RestController
@Log4j2
@RequestMapping("/sys")
public class TestController {

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/test")
//    @RequiresPermissions("sys:user:list")
    public String test(){
        log.info("---------消费者开始------------");
        //调用服务
        String result = restTemplate.getForObject("http://nacos-provider/provider", String.class);
        log.info("---------消费者结束--------result{}----", result);
        return result;
    }

}
